-----------------------------------	
-- Area: west ronfaure
-- NPC:  moogle
-----------------------------------	
	
require("/scripts/globals/settings");	
require("/scripts/globals/fieldsofvalor");	
require("scripts/globals/keyitems");
	
-----------------------------------	
-- onTrigger Action	
-----------------------------------	
	
function onTrigger(player,npc)
    local npc = GetNPCByID(17187546); -- mog-tablet west ronfare
	local tabletmove = player:getVar("kittygame"); -- move step

	npc:setPos(player:getXPos(),player:getYPos(),player:getZPos());
					player:messageSpecial(6403,537);
			


end;	
	
-----------------------------------	
-- onTrade Action	
-----------------------------------	
	
function onTrade(player,npc,trade)
    local npc = GetNPCByID(17187515); -- mog-tablet west ronfare
		if (trade:hasItemQty(4306,1) and (player:hasKeyItem(MOOGLE_KEY) == false)) then -- donko trade I want key item
			player:addKeyItem(MOOGLE_KEY);
		    player:setVar("kittygame",1);
			npc:setPos(-146,-3,16);
			player:messageSpecial(6394,1184);
			player:messageSpecial(6403,537);		
		elseif (trade:hasItemQty(4306,1) and (player:hasKeyItem(MOOGLE_KEY) == true)) then -- donko trade I want key item
			player:delKeyItem(MOOGLE_KEY);
			player:messageSpecial(6395,1184); 
			player:messageSpecial(6403,537);
		elseif (trade:hasItemQty(268,1) and player:getVar("mishimove")== 28) then 
		SpawnMob(17199438,300):updateEnmity(player); -- spawn hobgoblin beastmaster
		player:messageSpecial(6657);		
		player:tradeComplete(trade);
		player:setVar("mishimove",1);
		npc:setPos(-208,0,-50);	
		end
end;	
	
-----------------------------------	
-- onEventSelection	
-----------------------------------	
	
function onEventUpdate(player,csid,menuchoice)	
	updateFov(player,csid,menuchoice,7,8,9,10,57);
end;	
	
-----------------------------------	
-- onEventFinish Action	
-----------------------------------	
	
function onEventFinish(player,csid,option)	
	finishFov(player,csid,option,7,8,9,10,57,FOV_MSG_VALKURM);
end;	
